package finance

import grails.test.*

class FrequenceServiceIntegrationTests extends GrailsUnitTestCase {
    protected void setUp() {
        super.setUp()
    }

    protected void tearDown() {
        super.tearDown()
    }

    def frequenceService;
	
    void testFrequence() {
		assertNotNull frequenceService
		def frequencies = frequenceService.frequence([1.0, 1.5, 32.0])
		assertNotNull frequencies
		assertEquals "Number of bins incorrect", 30, frequencies.size()	
		
		def store = 0
		
		frequencies.each { key,value -> store += value }
		
		assertEquals 3, store
    }
	
	void testStep() {
		assertEquals 1.0, frequenceService.calcStep([0,30.0])
	}
}
